#include <iostream>
#include <string.h>
using namespace std;

// 银行账户类
class bankaccount
{
public:
        // 存款
        void deposit(double amount)
        {
            if (amount > 0)
            {
                balance += amount;
            }
            else
            {
                cout << "存款金额必须大于0" << endl;
            }
                cout << "存款" << amount << "成功" << endl;
                // cout << "当前余额为：" << balance << endl;
        }

        // 取款
        void withdraw(double amount)
        {
            if (amount > 0 && amount <= balance)
            {
                balance -= amount;
            }
            else
            {
                cout << "取款金额必须大于0且不超过余额" << endl;
            }
                cout << "取款" << amount << "成功" << endl;
                // cout << "当前余额为：" << balance << endl;
        }

        // 查询余额
        void getBalance()
        {
            cout << "当前余额为：" << balance << endl;
        }
private:
    char accountNumber[100]; // 账户号
    double balance;          // 余额
};

int main()
{
    // 创建一个银行账户对象
    bankaccount account;
    account.deposit(1000); // 存款1000元
    account.withdraw(500); // 取款500元
    account.getBalance();  // 查询余额
    return 0;
}